package com.example.common.base

import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import androidx.databinding.DataBindingUtil
import androidx.databinding.ViewDataBinding
import com.blankj.utilcode.util.ToastUtils
import com.gyf.immersionbar.ImmersionBar
import com.gyf.immersionbar.ktx.immersionBar

/**
 * 基础Activity
 */
abstract class BaseActivity<VDB:ViewDataBinding>:AppCompatActivity() {

    lateinit var mDataBinding: VDB

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        mDataBinding = DataBindingUtil.setContentView(this,getLayoutId())
        ImmersionBar.with(this).init()
        initViews()
    }
  fun showToastMessage(msg:String){
      if(msg.isNotEmpty()){
          ToastUtils.showLong(msg)
      }
  }
    abstract fun initViews()

    abstract fun getLayoutId(): Int

}